#!/bin/bash
# run-server --- Start a web server on the current directory (port 8080 default).
BIN_DIR="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)"
source $BIN_DIR/.envrc

if [[ "$1" == "" ]]; then
    PORT=8080
else
    PORT=$1
fi

echo "Serving $(pwd) on port $PORT."

python -m webbrowser -t http://localhost:$PORT
python -m SimpleHTTPServer $PORT
